home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat3 / f90 / minloc.z / minloc
Text File  |  1998-10-30  |  6KB  |  141 lines

  1. MINLOC(3I)                                             Last changed: 2-5-98
  2.  
  3.  
  4. NNAAMMEE
  5.      MMIINNLLOOCC - Returns the location of a minimum value in an array
  6.  
  7. SSYYNNOOPPSSIISS
  8.      MMIINNLLOOCC (([AARRRRAAYY==]_a_r_r_a_y [,,[DDIIMM==]_d_i_m] [,,[MMAASSKK==]_m_a_s_k]))
  9.  
  10.      MMIINNLLOOCC (([AARRRRAAYY==]_a_r_r_a_y [,,[MMAASSKK==]_m_a_s_k]))
  11.  
  12. IIMMPPLLEEMMEENNTTAATTIIOONN
  13.      UNICOS, UNICOS/mk, and IRIX systems
  14.  
  15. SSTTAANNDDAARRDDSS
  16.      Fortran 90
  17.  
  18. DDEESSCCRRIIPPTTIIOONN
  19.      The MMIINNLLOOCC intrinsic function can be used for array location.  It
  20.      returns the location of the first element of _a_r_r_a_y that has the
  21.      minimum value of the elements identified by _m_a_s_k.  It accepts the
  22.      following arguments:
  23.  
  24.      _a_r_r_a_y     Must be of type integer or real.  It must not be scalar.
  25.  
  26.      _d_i_m       Must be a scalar integer value in the range 1 <= _d_i_m <= _n,
  27.                where _n is the rank of _a_r_r_a_y.  The corresponding actual
  28.                argument must not be an optional dummy argument.  This
  29.                function does a check on _d_i_m when present.
  30.  
  31.      _m_a_s_k      Must be of type logical and must be conformable with _a_r_r_a_y.
  32.  
  33.      MMIINNLLOOCC is a transformational function.  The name of this intrinsic
  34.      cannot be passed as an argument.
  35.  
  36. NNOOTTEESS
  37.      On UNICOS systems, both execution speed and the number of bits used in
  38.      mathematical operations are affected when compiling with
  39.      ff9900 --OO ffaassttiinntt, which is the default setting.  For more information,
  40.      see _C_F_9_0 _C_o_m_m_a_n_d_s _a_n_d _D_i_r_e_c_t_i_v_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication
  41.      SR-3901.
  42.  
  43. RREETTUURRNN VVAALLUUEESS
  44.      The result is an integer array of type default integer, of rank one,
  45.      with size equal to the rank of _a_r_r_a_y.
  46.  
  47.      The result of MMIINNLLOOCC((_a_r_r_a_y)) is a rank-one array whose element values
  48.      are the values of the subscripts of an element of _a_r_r_a_y whose value
  49.      equals the minimum value of all of the elements of _a_r_r_a_y.  The _ith
  50.      subscript returned lies in the range 1 to _e ,
  51.                                                 _i
  52.      where _e
  53.             _i
  54.      is the extent of the _ith dimension of _a_r_r_a_y.  If more than one element
  55.      has the minimum value, the element whose subscripts are returned is
  56.      the first such element, taken in array element order.  If _a_r_r_a_y has
  57.      size zero, the value of the result is undefined.
  58.  
  59.      The result of MMIINNLLOOCC((_a_r_r_a_y,,MMAASSKK==_m_a_s_k)) is a rank-one array whose
  60.      element values are the values of the subscripts of an element of
  61.      _a_r_r_a_y, corresponding to a true element of _m_a_s_k whose value equals the
  62.      minimum value of all such elements of _a_r_r_a_y.  The _ith subscript
  63.      returned lies in the range 1 to _e ,
  64.                                       _i
  65.      where _e
  66.             _i
  67.      is the extent of the _ith dimension of _a_r_r_a_y.  If more than one such
  68.      element has the minimum value, the element whose subscripts are
  69.      returned is the first such element taken in array element order.  If
  70.      there are no such elements (that is, if _a_r_r_a_y has size zero or every
  71.      element of _m_a_s_k has the value false), the value of the result is
  72.      undefined.
  73.  
  74.      If _a_r_r_a_y has rank one, the result of
  75.      MMIINNLLOOCC((_a_r_r_a_y,, DDIIMM==_d_i_m [,, MMAASSKK==_m_a_s_k])) is a scalar with a value that is
  76.      the same as that of the first element of MMIINNLLOOCC((_a_r_r_a_y [,, MMAASSKK==_m_a_s_k])).
  77.      Otherwise, the value of element (_s , _s , ..., _s     , _s     , ..., _s )
  78.                                        1   2        _d_i_m-1   _d_i_m+1        _n
  79.      of the result is equal to
  80.      MMIINNLLOOCC((_a_r_r_a_y(_s , _s , ..., _s     , : , _s     , ..., _s )),, DDIIMM==11
  81.                    1   2        _d_i_m-1       _d_i_m+1        _n
  82.      [,, MMAASSKK==_m_a_s_k(_s , _s , ..., _s     , : , _s     , ..., _s )])).
  83.                    1   2        _d_i_m-1       _d_i_m+1        _n
  84.      An element of the result is undefined if the value cannot be
  85.      represented as an integer.
  86.  
  87. EEXXAAMMPPLLEESS
  88.      Example 1:  The value of MMIINNLLOOCC(( ((// 44,, 33,, 66,, 33 //)) )) is [2].  If array
  89.      B is declared IINNTTEEGGEERR,, DDIIMMEENNSSIIOONN((44::77)) :::: BB == ((//88,, 66,, 33,, 11 //)), the
  90.      value of MMIINNLLOOCC((BB)) is [4].
  91.  
  92.      Example 2:  Assume that AA is the following array:
  93.  
  94.         | 0 -5  8 -3 |
  95.  
  96.         | 3  4 -1  2 |
  97.  
  98.         | 1  5  6 -4 |
  99.  
  100.      The following are true:
  101.  
  102.           MMIINNLLOOCC((AA)) is [1, 2]
  103.  
  104.           MMIINNLLOOCC((AA,, MMAASSKK==AA ..GGTT.. --44)) is [1, 4]
  105.  
  106.      Using array section references, the following are true:
  107.  
  108.           MMIINNLLOOCC((AA((22::33,,22::44)))) is [ 2, 3 ]
  109.  
  110.           MMIINNLLOOCC((AA((22::33,,22::44)),,MMAASSKK==AA((22::33,,22::44))..GGTT..--44)) is [ 1, 2 ]
  111.  
  112.      Example 3:  Assume that BB is the following array:
  113.  
  114.           [ 100, 2, 5, 7, 1, 90, 0, 20, -1, 80 ]
  115.  
  116.      The following are true:
  117.  
  118.           MMIINNLLOOCC((BB((1100::11::--11)))) is 2
  119.  
  120.           MMIINNLLOOCC((BB((1100::11::--22)))) is 5
  121.  
  122.      Example 4:  The value of MMIINNLLOOCC((((//55,,--99,,33//)),,DDIIMM==11)) is 22.
  123.  
  124.      Example 5:  Assume that CC is the following array:
  125.  
  126.         | 1 3 -9 |
  127.  
  128.         | 2 2  6 |
  129.  
  130.      The following are true of this array:
  131.  
  132.           MMIINNLLOOCC((CC,,DDIIMM==11)) is [ 1, 2, 1 ]
  133.  
  134.           MMIINNLLOOCC((CC,,DDIIMM==22)) is [ 3, 1 ]
  135.  
  136.           MMIINNLLOOCC((CC)) is [ 3, 1 ]
  137.  
  138. SSEEEE AALLSSOO
  139.      _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication SR-2138, for the
  140.      printed version of this man page.
  141.